<?php

use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


//用户登录注销
Route::get('/login',[UserController::class,'login'])->name('login');
Route::post('/login',[UserController::class,'doLogin']);
Route::get('/logout',[UserController::class,'logout']);
//后台管理
Route::get('/adm',[UserController::class,'admin']);//后台首页

Route::prefix('/adm')->group(function (){
    Route::get('/expertlist',[\App\Http\Controllers\ExpertController::class,'ExpertList']);//后台专家列表页
    Route::get('/user',[UserController::class,'index']);//后台用户列表页
    Route::get('/user/add',[UserController::class,'create']);//后台新增管理员页
    Route::post('/user/add',[UserController::class,'store']);
    Route::get('/user/edit/{id}',[UserController::class,'edit']);//后台更改密码
    Route::post('/user/edit/{id}',[UserController::class,'update']);
    Route::get('/expert/add',[\App\Http\Controllers\ExpertController::class,'create']);//后台新增医生页
    Route::post('/expert/add',[\App\Http\Controllers\ExpertController::class,'store']);
    Route::get('/expert/edit/{id}',[\App\Http\Controllers\ExpertController::class,'edit']);//后台更改信息
    Route::post('/expert/edit/{id}',[\App\Http\Controllers\ExpertController::class,'update']);
    Route::get('/video',[\App\Http\Controllers\VideoController::class,'VideoList']);//后台问卷列表页
    Route::get('/video/add',[\App\Http\Controllers\VideoController::class,'create']);//后台新增管理员页
    Route::post('/video/add',[\App\Http\Controllers\VideoController::class,'store']);
    Route::get('/video/edit/{id}',[\App\Http\Controllers\VideoController::class,'edit']);//后台更改密码
    Route::post('/video/edit/{id}',[\App\Http\Controllers\VideoController::class,'update']);
    Route::get('/expert/delexpert/{id}',[UserController::class,' destroy']);//后台删除专家
//    Route::get('/user/deluser/{id}',[UserController::class,' destroy']);//后台删除用户



Route::delete('/expert/deluser/{id}',[\App\Http\Controllers\ExpertController::class,'destroy']);


});
//前台路由
Route::get('/expert/info/{id}',[\App\Http\Controllers\ExpertController::class,'expertinfo']);
Route::get('/review/review-info/{id}',[\App\Http\Controllers\VideoController::class,'videoinfo']);
Route::get('/',[\App\Http\Controllers\ExpertController::class,'index'] );//前台
Route::get('/conf',[\App\Http\Controllers\VideoController::class,'jiangtang'] );//名师讲堂
Route::get('/expert',[\App\Http\Controllers\ExpertController::class,'expert'] );//专家风采
Route::get('/review',[\App\Http\Controllers\VideoController::class,'review'] );//往期视频


